package musicserver;

import java.io.Serializable;
import java.util.ArrayList;

public class Artist implements Serializable{
	private static final long serialVersionUID = -2408061526293600056L;
	String name;
	ArrayList<Album> albums;
	
	public Artist(String n){
		name = n;
		albums = new ArrayList<Album>();
	}
	
	public Album addAlbum(String n){
		for (Album a : albums) {
			if(a.getName().equals(n))
				return a;
		}
		Album t = new Album(n);
		albums.add(t);
		return t;
	}
	
	public ArrayList<Album> getAlbums(){
		return albums;
	}

	public String getName() {
		return name;
	}
	

}
